package com.sailor.util;

import java.util.*;

/**
 * 多机房环境变量定义
 * @author Sailor
 * @date 2022-11-14 17:36:36
 */
public enum IdcDefinition {
  /** 巢湖星光 */
  BJXG("CHXG"),
  /** 阿里云 */
  ALIYUN("ALIYUN");

  private String name;

  IdcDefinition(String name) {
    this.name = name;
  }

  public static final IdcDefinition DEFAULT = IdcDefinition.BJXG;
  public static final Map<String, IdcDefinition> m = new HashMap<>();

  static {
    for (IdcDefinition d : values()) {
      m.put(d.name, d);
    }
  }

  public static IdcDefinition of(String idcName) {
    return m.getOrDefault(idcName, IdcDefinition.DEFAULT);
  }

}
